<?php
$header=array(
'id',
'email',
'name',
'adress'
);
$header = array_map('strtoupper',$header);
$users= array (
    array('1001', 'Abhishek','abhi@gmail.com','Noida sec 56'),
    array('1002', 'Virendra','veer@gmail.com','Delhisec 56'),
    array('1003', 'Aslam','aslam@gmail.com','Noida sec 15'),
    array('1004', 'Akhilesh','akhil@gmail.com','GZB sec 56'),
    
);
array_unshift($users,$header);
var_export($users);
$fp = fopen('users.csv', 'w');

foreach ($users as $fields) {
    fputcsv($fp, $fields, ',');
}

fclose($fp);
